/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller,io } = app;
  router.get('/', controller.home.index);
  router.post('/manager/list', controller.manager.index);
  router.post('/manager/add', controller.manager.addmanager);
  router.post('/manager/edit', controller.manager.editmanager);
  router.post('/manager/delete', controller.manager.deleteUser);
  router.post('/login', controller.home.login);
  router.post('/userlogin', controller.home.userlogin);
  router.post("/upload",controller.common.upload)
  router.post('/user/list', controller.user.list);
  router.post('/user/add', controller.user.adduser);
  router.post('/user/update', controller.user.updateuser);
  router.post('/user/edit', controller.user.edituser);
  router.post('/user/delete', controller.user.deleteUser);
  router.post('/gift/list', controller.gift.list);
  router.post('/gift/add', controller.gift.add);
  router.post('/gift/edit', controller.gift.edit);
  router.post('/gift/delete', controller.gift.deleteGift);
  router.post('/order/list', controller.order.list);
  router.post('/order/delete', controller.order.delete);
  router.post('/live/list', controller.live.list);
  router.post('/live/mobilelist', controller.live.list1);
  router.post('/live/add', controller.live.addlive);
  router.post('/live/edit', controller.live.editlive);
  router.post('/live/info', controller.live.liveinfo);
  router.post('/liveuser/list', controller.liveuser.list);
  router.post('/livegift/list', controller.livegift.list);
  router.post('/livecontent/list', controller.content.list);
  router.post('/livecontent/closezb', controller.content.closezb);
router.post("/gift/wxpay",controller.gift.wxpay)

router.post("/gift/notify",app.middleware.tenpay("pay",app), controller.gift.notify)
io.of("/").route("joinlive",io.controller.nsp.joinlive)
io.of("/").route("leavelive",io.controller.nsp.leavelive)
io.of("/").route("comment",io.controller.nsp.comment)
io.of("/").route("gift",io.controller.nsp.gift)
};
